#ifndef EVENTEATER_H
#define EVENTEATER_H

#include <QObject>
#include <functional>

class EventEater : public QObject
{
    Q_OBJECT
public:
    explicit EventEater(QObject *parent = nullptr, std::function<bool(QObject *watched, QEvent *event)> func = nullptr);


private:
    std::function<bool(QObject *watched, QEvent *event)> m_func;

    // QObject interface
public:
    bool eventFilter(QObject *watched, QEvent *event) override;
};

#endif // EVENTEATER_H
